package com.arpa.wms.domain.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * @author: Allen chen
 * @Date 2020/8/17
 * @Description:
 */
public enum InventoryRecordTypeEnum implements IEnum<String> {
/*    RECEIVE("0","收货"),
    CANCEL_RECEIVE("1","取消收货"),
    INBOUND("2","入库"),
    DISTRIBUTION("3","分配"),
    CANCEL_DISTRIBUTION("4","取消分配"),
    STOCKOUT("5","缺货"),
    OUTBOUND("6","出库"),
    INVENTORY_ADJUST("7","库存调整"),*/

/*
    相关操作
    收货： 包括收货登记、取消收货；
    入库： 上架入库；
    拣货： 库存分配、取消分配、拣货、拣货确认退减
    出库： 出库、出库单复核退减
    库存调整： 库存调整
 */
    /**
     * 库存登记类型
     */
    RECEIVE("receive","收货"),
    INBOUND("inbound","入库"),
    DELIVERY("delivery", "发货"),
    PICK("pick","拣货"),
    OUTBOUND("outbound","出库"),
    ADJUST("adjust","库存调整"),
    LOCATION_MOVE("move","移位"),
    INITIALIZATION("initialization","期初入库"),
    PREPACKAGED("prepackaged","预打包"),
    COUNTING("counting","盘点"),
    ;
    /**
     * 值
     */
    private final String value;

    /**
     * 描述
     */
    private final String desc;

    InventoryRecordTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String translate(String value){
        for (InventoryRecordTypeEnum ele : values()) {
            if(ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String toString(){
        return this.desc;
    }

    public String getDesc() {
        return desc;
    }

}
